<script setup>
import bg from '@/assets/bg.png';

const props = defineProps({
  code: {
    type: String,
    default: "403",
  },
  msg: {
    type: String,
    default: "错误",
  }
})
const codeUrl = require(`@/assets/${props.code}.png`);
</script>
<template>
  <div class="error-out flex-center">
    <div class="inner" :style="{'background-image':`url(${bg})`}">
      <el-image
          class="img"
          :src="codeUrl"
          fit="contain"
      ></el-image>
      <p><span>{{ msg }}</span>&nbsp;
        <router-link to="/dashboard">回到首页</router-link>
      </p>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.error-out {
  height: 100%;
  width: 100%;

  .inner {
    text-align: center;

    .img {
      width: 400px;
      height: auto;
    }
  }
}
</style>


